﻿@using SmartStore.Core.Domain.Orders;
@model ReturnRequestModel

@Html.ValidationSummary(false)
@Html.HiddenFor(model => model.Id)

@if (Model.ReturnRequestInfo.HasValue())
{
	<div class="alert alert-info alert-dismissible">
		@Html.Raw(Model.ReturnRequestInfo)
		<button type="button" class="close" data-dismiss="alert">&times;</button>
	</div>
}

@{ Html.RenderWidget("returnrequest_top"); }

<table class="adminContent">
    <tr>
        <td class="adminTitle">
            @Html.SmartLabelFor(model => model.Id)
        </td>
        <td class="adminData">
			<div class="form-control-plaintext">
				@Model.Id
			</div>
        </td>
    </tr>
	@if (Model.StoreName.HasValue())
	{
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.StoreName)
			</td>
			<td class="adminData">
				<div class="form-control-plaintext">
					@Html.DisplayFor(model => model.StoreName)
				</div>
			</td>
		</tr>
	}
    <tr>
        <td class="adminTitle">
            @Html.SmartLabelFor(model => model.CustomerId)
        </td>
        <td class="adminData">
			<div class="form-control-plaintext">
				<a href="@Url.Action("Edit", "Customer", new { id = Model.CustomerId })">@Model.CustomerFullName</a> (@Model.CustomerId)
			</div>
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            @Html.SmartLabelFor(model => model.OrderId)
        </td>
        <td class="adminData">
			<div class="form-control-plaintext">
				<a href="@Url.Action("Edit", "Order", new { id = Model.OrderId })">@Model.OrderNumber</a>
			</div>
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            @Html.SmartLabelFor(model => model.ProductName)
        </td>
        <td class="adminData">
			<div class="form-control-plaintext">
				<div class="mb-1">
					<a href="@Url.Action("Edit", "Product", new { id = Model.ProductId })">@Model.ProductName</a>
				</div>
				@if (Model.AttributeInfo.HasValue())
				{
					<div>
						@Html.Raw(Model.AttributeInfo)
					</div>
				}
				@if (Model.ProductSku.HasValue())
				{
					<div>
						<span class="font-weight-medium">@T("Admin.Orders.Products.SKU")</span>: @Model.ProductSku
					</div>
				}
			</div>
        </td>
    </tr>
	@if (Model.MaxRefundAmount.HasValue())
	{
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.MaxRefundAmount)
			</td>
			<td class="adminData">
				<div class="form-control-plaintext">
					@Html.Raw(Model.MaxRefundAmount)
				</div>
			</td>
		</tr>
	}
    <tr>
        <td class="adminTitle">
            @Html.SmartLabelFor(model => model.Quantity)
        </td>
        <td class="adminData">
            @Html.EditorFor(model => model.Quantity)
            @Html.ValidationMessageFor(model => model.Quantity)
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            @Html.SmartLabelFor(model => model.ReturnRequestStatusId)
        </td>
        <td class="adminData">
            @Html.DropDownListFor(model => model.ReturnRequestStatusId, ((ReturnRequestStatus)Model.ReturnRequestStatusId).ToSelectList())
            @Html.ValidationMessageFor(model => model.ReturnRequestStatusId)
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            @Html.SmartLabelFor(model => model.ReasonForReturn)
        </td>
        <td class="adminData">
			@Html.DropDownListFor(model => model.ReasonForReturn, Model.AvailableReasonForReturn)
            @Html.ValidationMessageFor(model => model.ReasonForReturn)
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            @Html.SmartLabelFor(model => model.RequestedAction)
        </td>
        <td class="adminData">
			@Html.DropDownListFor(model => model.RequestedAction, Model.AvailableRequestedAction)
            @Html.ValidationMessageFor(model => model.RequestedAction)
        </td>
    </tr>
	@if(Model.RequestedActionUpdated.HasValue)
	{
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.RequestedActionUpdated)
			</td>
			<td class="adminData">
				@Html.DisplayFor(model => model.RequestedActionUpdated)
			</td>
		</tr>		
	}
    <tr>
        <td class="adminTitle">
            @Html.SmartLabelFor(model => model.CustomerComments)
        </td>
        <td class="adminData">
            @Html.TextAreaFor(model => model.CustomerComments, new { style = "min-height: 100px;" })
            @Html.ValidationMessageFor(model => model.CustomerComments)
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            @Html.SmartLabelFor(model => model.StaffNotes)
        </td>
        <td class="adminData">
            @Html.TextAreaFor(model => model.StaffNotes, new { style = "min-height: 100px;" })
            @Html.ValidationMessageFor(model => model.StaffNotes)
        </td>
    </tr>
	<tr>
		<td class="adminTitle">
			@Html.SmartLabelFor(model => model.AdminComment)
		</td>
		<td class="adminData">
			@Html.TextAreaFor(model => model.AdminComment, new { style = "min-height: 100px;" })
			@Html.ValidationMessageFor(model => model.AdminComment)
		</td>
	</tr>
    <tr>
        <td class="adminTitle">
            @Html.SmartLabelFor(model => model.CreatedOn)
        </td>
        <td class="adminData">
			<div class="form-control-plaintext">
				@Html.DisplayFor(model => model.CreatedOn)
			</div>
        </td>
    </tr>
	<tr>
		<td class="adminTitle">
			@Html.SmartLabelFor(model => model.UpdatedOn)
		</td>
		<td class="adminData">
			<div class="form-control-plaintext">
				@Html.DisplayFor(model => model.UpdatedOn)
			</div>
		</td>
	</tr>
</table>

@{ Html.RenderWidget("returnrequest_bottom"); }